package fr.mk25.papervision3d.core{
    import org.papervision3d.core.Number3D;
    import org.papervision3d.objects.DisplayObject3D;
    
    public class Position3D{
    
        public var x:Number;
        public var y:Number;
        public var z:Number;
        public var rotationX:Number;
        public var rotationY:Number;
        public var rotationZ:Number;
        

        public function Position3D(_x:Number=0, _y:Number=0, _z:Number=0, _rx:Number=0, _ry:Number=0, _rz:Number=0){
            x = _x;
            y = _y;
            z = _z;
            rotationX = _rx;
            rotationY = _ry;
            rotationZ = _rz;
            
        }

        public function toString():String{
            var currentCameraPosition:String = "Camera x = "+x;
            currentCameraPosition += "\nCamera y = "+y;
            currentCameraPosition += "\nCamera z = "+z;
            currentCameraPosition += "\n\nCamera rotationX = "+rotationX;
            currentCameraPosition += "\nCamera rotationY = "+rotationY;
            currentCameraPosition += "\nCamera rotationZ = "+rotationZ;
            return currentCameraPosition;
        }


        public function toObject():Object{
            return {x:x, y:y, z:z, rotationX:rotationX, rotationY:rotationY, rotationZ:rotationZ};
        }
        
        public static function getPosition3D(d:DisplayObject3D):Position3D{
            return new Position3D(d.x, d.y, d.z, d.rotationX, d.rotationY, d.rotationZ);
        }   
  
  
        public static function setPosition3D(d:DisplayObject3D, position:Position3D):void{
            d.x = position.x;
            d.y = position.y;
            d.z = position.z;
            d.rotationX = position.rotationX;
            d.rotationY = position.rotationY;
            d.rotationZ = position.rotationZ;
  
        }


    }
    
}
